#!/usr/bin/env node

console.log(process.argv[2],'\n',process.argv[3]);

const exp=process.argv[2],
      log=console.log;

if(typeof(exp)=='undefined' ||exp === '--help' || exp ==='-h'){
  instru();
}else{
  calc();
}
function instru(){
  log('请输入正确命令行参数，应为合法数学表达式');
}
function calc(){
  try{
  log(`${exp}=${eval(exp)}`);
  }catch(e){
    console.error(`${exp}不是合法的字符串`);
  }
}
